package com.alice.util;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * json数据实体
 *
 * @author LJH
 */
@Data
@AllArgsConstructor
@NoArgsConstructor

public class DataGridView<T> {
    @ApiModelProperty(value = "返回码", required = true)
    private Integer code = 0;
    @ApiModelProperty(value = "返回消息", required = false)
    private String msg = "";
    @ApiModelProperty(value = "返回数量", required = false)
    private Long count = 0L;
    @ApiModelProperty(value = "返回参数", required = false)
    private Object obj;
    @ApiModelProperty(value = "返回参数", required = false)
    private T data;

    private Object object;

    @ApiModelProperty(value = "父级部门", required = false)
    private int parentId;

    public DataGridView(Integer code, String msg, Object obj, T data, int parentId) {
        this.code = code;
        this.msg = msg;
        this.obj = obj;
        this.data = data;
        this.parentId = parentId;
    }

    public DataGridView(Object obj, T data) {
        this.obj = obj;
        this.data = data;
    }

    public DataGridView(Long count, T data) {
        this.count = count;
        this.data = data;
    }

    public DataGridView(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public DataGridView(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public DataGridView(Integer code, String msg, T data, Object obj) {
        this.code = code;
        this.msg = msg;
        this.obj = obj;
        this.data = data;
    }

    public DataGridView(Integer code, T data, Object obj, Object object) {
        this.code = code;

        this.obj = obj;
        this.data = data;
        this.object = object;
    }

    public DataGridView(T data) {
        this.data = data;
    }


}
